<template>
  <div id="app">
    <div style="height: 2.5rem;text-align: center;">
      <div style="display: inline-block;border-top: 1px solid #FFFFFF;padding: 0 50px;height: 10px;"></div>
      <span style="color: #ffffff;line-height: 2.5rem;font-size: 28px;">员工信息登记表</span>
      <div style="display: inline-block;border-top: 1px solid #FFFFFF;padding: 0 50px;height: 10px;"></div>
    </div>
    <div class="box">
      <div style="padding: 0.375rem 2.5rem;">
        <el-steps :active="active" finish-status="success" process-status="finish">
          <el-step title="岗位信息"></el-step>
          <el-step title="个人基本信息"></el-step>
          <el-step title="教育情况"></el-step>
          <el-step title="工作经历"></el-step>
          <el-step title="其他情况说明"></el-step>
        </el-steps>
      </div>
      <div style="margin: 0 100px;border-bottom: 1px solid #eeeeee;line-height: 0.625rem;">
        <i class="el-icon-edit" style="color: #da7937;"></i>
        {{titleList[active]}}
      </div>
      <div style="margin: 20px 50px;height: calc(100% - 260px);">
        <el-form ref="form" :model="form" inline label-width="1.5rem" :rules="rules" style="overflow: auto;overflow-x:hidden;height: 100%">
          <div v-if="active == 0" style="overflow-x: hidden">
            <el-form-item label="应聘岗位:" label-width="1.125rem" prop="position">
              <el-input  v-model="form.position" placeholder="请输入"></el-input>
            </el-form-item>
            <el-form-item label="岗位招聘信息渠道:" label-width="1.9rem" prop="channel">
              <el-select v-model="form.channel"
                         placeholder="请选择" clearable>
                <el-option
                  v-for="item in radioList"
                  :key="item.label"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="推荐人姓名:" label-width="1.25rem" prop="referee">
              <el-input placeholder="请输入" v-model="form.referee"></el-input>
            </el-form-item>
          </div>

          <div v-if="active == 1">
            <el-form-item label="姓名:"  prop="name">
              <el-input placeholder="请输入" v-model="form.name"></el-input>
            </el-form-item>
            <el-form-item label="性别:"  prop="sex">
              <el-select v-model="form.sex"
                         style="width: 2.3rem"
                         placeholder="请选择" clearable>
                <el-option
                  v-for="item in sexList"
                  :key="item.label"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="民族:" prop="nation">
              <el-select v-model="form.nation"
                         style="width: 2.3rem"
                         placeholder="请选择" clearable>
                <el-option
                  v-for="item in nationList"
                  :key="item.label"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="出生年月:"  prop="birthDate" >
              <el-date-picker
                v-model="form.birthDate"
                type="date"
                style="width: 2.3rem"
                placeholder="选择日期">
              </el-date-picker>
            </el-form-item>
            <el-form-item label="籍贯:" prop="nativePlace" >
              <el-input
                style="width: 2.3rem"
                v-if="form.nativePlace"
                v-model="form.nativePlace"
                placeholder="请输入项目地点"
              >
                <i
                  slot="suffix"
                  class="el-icon-close"
                  @click="loadMap"
                  style="cursor: pointer;"
                ></i>
              </el-input>
              <el-cascader
                v-else
                size="large"
                style="width: 2.3rem"
                :options="options"
                v-model="selectedOptions"
                @change="addressChange"
                clearable
              ></el-cascader>
            </el-form-item>
            <el-form-item label="家庭所在地:" prop="homeLocation">
              <el-input placeholder="请输入" v-model="form.homeLocation"></el-input>
            </el-form-item>
            <el-form-item label="身份证号:" prop="idNumber">
              <el-input placeholder="请输入" v-model="form.idNumber"></el-input>
            </el-form-item>
            <el-form-item label="婚育状况:" prop="maritalStatus">
              <el-select v-model="form.maritalStatus"
                         style="width: 2.3rem"
                         placeholder="请选择" clearable>
                <el-option
                  v-for="item in maritalStatusList"
                  :key="item.label"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
<!--              <el-input placeholder="请输入" v-model="form.maritalStatus"></el-input>-->
            </el-form-item>
            <el-form-item label="政治面貌:" prop="politicalOutlook">
              <el-select v-model="form.politicalOutlook"
                         style="width: 2.3rem"
                         placeholder="请选择" clearable>
                <el-option
                  v-for="item in politicalOutlookList"
                  :key="item.label"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
<!--              <el-input placeholder="请输入" v-model="form.politicalOutlook"></el-input>-->
            </el-form-item>
            <el-form-item label="身高(cm):" prop="height">
              <el-input placeholder="请输入"
                        @input="form.height=form.height.replace(/^\D*([0-9]\d*\.?\d{0,2})?.*$/,'$1')"
                        v-model="form.height"></el-input>
            </el-form-item>
            <el-form-item label="体重(kg):" prop="weight">
              <el-input placeholder="请输入"
                        @input="form.weight=form.weight.replace(/^\D*([0-9]\d*\.?\d{0,2})?.*$/,'$1')"
                        v-model="form.weight"></el-input>
            </el-form-item>
            <el-form-item label="特长:" prop="speciality">
              <el-input placeholder="请输入" v-model="form.speciality"></el-input>
            </el-form-item>
            <el-form-item label="技术职称:" prop="technicalTitle">
              <el-input placeholder="请输入" v-model="form.technicalTitle"></el-input>
            </el-form-item>
            <el-form-item label="手机号码:" prop="phone">
              <el-input placeholder="请输入"
                        @input="form.phone=form.phone.replace(/^\D*([0-9]\d*)?.*$/,'$1')"
                        v-model="form.phone" maxlength="11"></el-input>
            </el-form-item>
            <el-form-item label="邮箱:" prop="email">
              <el-input placeholder="请输入" v-model="form.email"></el-input>
            </el-form-item>
            <div>
              <el-form-item label="身份证地址(详细):" prop="address" label-width="2.125rem" style="width: 100%" class="mailAddress">
                <el-input placeholder="请输入" v-model="form.address"></el-input>
              </el-form-item>
            </div>
            <div>
              <el-form-item label="通讯地址(详细住址):" prop="mailAddress" style="width: 100%" label-width="2.125rem" class="mailAddress">
                <el-input placeholder="请输入" v-model="form.mailAddress"></el-input>
              </el-form-item>
            </div>
            <el-form-item label="紧急联系人姓名:" prop="emergencyName" label-width="1.625rem">
              <el-input placeholder="请输入" v-model="form.emergencyName"></el-input>
            </el-form-item>
            <el-form-item label="紧急联系人关系:" prop="emergencyRelation" label-width="1.625rem">
              <el-input placeholder="请输入" v-model="form.emergencyRelation"></el-input>
            </el-form-item>
            <el-form-item label="紧急联系人电话:" prop="emergencyPhone" label-width="1.625rem">
              <el-input placeholder="请输入"
                        @input="form.emergencyPhone=form.emergencyPhone.replace(/^\D*([0-9]\d*)?.*$/,'$1')"
                        v-model="form.emergencyPhone" maxlength="11"></el-input>
            </el-form-item>
          </div>
          <div v-if="active ==2">
            <el-form-item label="教育清单:" label-width="1.125rem">
              <el-button
                type="primary"

                icon="el-icon-plus"
                size="mini"
                @click="applyAddRow(educationList)"
              >添加教育经历</el-button>
            </el-form-item>
            <el-table
              ref="table"
              :data="educationList"
              style="width: 100%;margin-bottom:0.125rem"
              border
            >
              <el-table-column label="序号" align="center" width="55" prop="xh" type="index"></el-table-column>
              <el-table-column prop="submitDateList" label="起讫时间" align="center" width="330">
                <template slot-scope="scope">
                  <el-date-picker
                    v-model="scope.row.submitDateList"
                    type="monthrange"
                    range-separator="至"
                    start-placeholder="开始月份"
                    end-placeholder="结束月份">
                  </el-date-picker>
<!--                  <el-input v-model="scope.row.itemName"></el-input>-->
                </template>
              </el-table-column>
              <el-table-column prop="school" label="学校" align="center" width="180">
                <template slot-scope="scope">
                  <el-input v-model="scope.row.school" ></el-input>
                </template>
              </el-table-column>
              <el-table-column prop="major" label="专业" align="center" width="180">
                <template slot-scope="scope">
                  <el-input v-model="scope.row.major"></el-input>
                </template>
              </el-table-column>
              <el-table-column prop="qualification" label="学历" align="center" width="180">
                <template slot-scope="scope">
                  <el-input
                    v-model="scope.row.qualification"
                  ></el-input>
                </template>
              </el-table-column>
              <el-table-column prop="educationForm" label="学历形式" align="center" width="290">
                <template slot-scope="scope">
                  <el-select v-model="scope.row.educationForm"
                             style="width: 2.875rem;"
                             placeholder="请选择" clearable>
                    <el-option
                      v-for="item in educationFormList"
                      :key="item.label"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </template>
              </el-table-column>
              <el-table-column fixed="right" label="操作" align="center">
                <template slot-scope="scope">
                  <el-button
                    size="small"
                    @click.native.prevent="applyDeleteRow(scope.$index, educationList)"
                  >移除</el-button>
                </template>
              </el-table-column>
            </el-table>
            <el-form-item label="上传学历附件:" style="width: 100%">
              <file-upload
                v-model="form.educationAttachmnet"
                style="width: 280px;"
                :limit="5"
              />
            </el-form-item>
          </div>
          <div v-if="active ==3">
            <el-form-item label="工作经历清单:" label-width="1.375rem">
              <el-button
                type="primary"

                icon="el-icon-plus"
                size="mini"
                @click="jobAddRow(jobList)"
              >添加工作经历</el-button>
            </el-form-item>
            <el-table
              ref="table"
              :data="jobList"
              style="width: 100%;margin-bottom:0.125rem"
              border
            >
              <el-table-column label="序号" align="center" width="55" prop="xh" type="index"></el-table-column>
              <el-table-column prop="submitDateList" label="起讫时间" align="center" width="330">
                <template slot-scope="scope">
                  <el-date-picker
                    v-model="scope.row.submitDateList"
                    type="monthrange"
                    range-separator="至"
                    start-placeholder="开始月份"
                    end-placeholder="结束月份">
                  </el-date-picker>
                  <!--                  <el-input v-model="scope.row.itemName"></el-input>-->
                </template>
              </el-table-column>
              <el-table-column prop="unit" label="工作单位" align="center" width="180">
                <template slot-scope="scope">
                  <el-input v-model="scope.row.unit" ></el-input>
                </template>
              </el-table-column>
              <el-table-column prop="position" label="所任职务" align="center" width="180">
                <template slot-scope="scope">
                  <el-input v-model="scope.row.position"></el-input>
                </template>
              </el-table-column>
              <el-table-column prop="salary" label="税前年度综合收入(元)" align="center" width="180">
                <template slot-scope="scope">
                  <el-input
                    @input="scope.row.salary=scope.row.salary.replace(/^\D*([0-9]\d*\.?\d{0,2})?.*$/,'$1')"
                    v-model="scope.row.salary"
                  ></el-input>
                </template>
              </el-table-column>
              <el-table-column prop="certifier" label="证明人及职务" align="center" width="230">
                <template slot-scope="scope">
                  <el-input
                    v-model="scope.row.certifier"
                  ></el-input>
                </template>
              </el-table-column>
              <el-table-column prop="phone" label="证明人电话" align="center" width="230" >
                <template slot-scope="scope">
                  <el-input
                    maxlength="11"
                    v-model="scope.row.phone"
                    @input="scope.row.phone=scope.row.phone.replace(/^\D*([0-9]\d*)?.*$/,'$1')"
                  ></el-input>
                </template>
              </el-table-column>
              <el-table-column fixed="right" label="操作" align="center">
                <template slot-scope="scope">
                  <el-button
                    @click.native.prevent="applyDeleteRow(scope.$index, jobList)"
                    size="small"
                  >移除</el-button>
                </template>
              </el-table-column>
            </el-table>
          </div>
          <div v-if="active ==4">
            <div>
              <el-form-item label="是否有犯罪记录:" label-width="2.25rem" prop="isCrime">
                <el-select v-model="form.isCrime"
                           @change="isCrimeChange"
                           placeholder="请选择" clearable>
                  <el-option
                    v-for="item in isExperienceList"
                    :key="item.label"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="请说明:" v-if="form.isCrime=='是'" label-width="1rem" prop="crimeExperience">
                <el-input placeholder="请输入" v-model="form.crimeExperience"></el-input>
              </el-form-item>
            </div>
            <div>
              <el-form-item label="是否有违规违纪记录:" label-width="2.25rem" prop="isViolation">
                <el-select v-model="form.isViolation"
                           @change="violationChange"
                           placeholder="请选择" clearable>
                  <el-option
                    v-for="item in isExperienceList"
                    :key="item.label"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="请说明:" v-if="form.isViolation=='是'" label-width="1rem" prop="violationExperience">
                <el-input placeholder="请输入" v-model="form.violationExperience"></el-input>
              </el-form-item>
            </div>
            <div>
              <el-form-item label="曾否因大病入院或患有特殊疾病:" label-width="3.125rem" prop="isHospital">
                <el-select v-model="form.isHospital"
                           @change="hospitalChange"
                           placeholder="请选择" clearable>
                  <el-option
                    v-for="item in isExperienceList"
                    :key="item.label"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="请说明:" v-if="form.isHospital=='是'" label-width="1rem" prop="hospitalExperience">
                <el-input placeholder="请输入" v-model="form.hospitalExperience"></el-input>
              </el-form-item>
            </div>
            <div>
              <el-form-item label="是否对其他公司负竞业限制义务:" label-width="3.125rem" prop="isLimit">
                <el-select v-model="form.isLimit"
                           @change="limitChange"
                           placeholder="请选择" clearable>
                  <el-option
                    v-for="item in isExperienceList"
                    :key="item.label"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="请说明:" v-if="form.isLimit=='是'" label-width="1rem" prop="limitExperience">
                <el-input placeholder="请输入" v-model="form.limitExperience"></el-input>
              </el-form-item>
            </div>
           <div>
             <el-form-item label="是否曾在本集团及所属分子公司任职或建立过劳动关系:" label-width="4.875rem" prop="isEntry">
               <el-select v-model="form.isEntry"
                          @change="entryChange"
                          placeholder="请选择" clearable>
                 <el-option
                   v-for="item in isExperienceList"
                   :key="item.label"
                   :label="item.label"
                   :value="item.value"
                 ></el-option>
               </el-select>
             </el-form-item>
             <el-form-item label="请说明:" v-if="form.isEntry=='是'" label-width="1rem" prop="entryExperience">
               <el-input placeholder="请输入" v-model="form.entryExperience"></el-input>
             </el-form-item>
           </div>
            <div>
              <el-form-item class="mailAddress" label="其他补充说明：" label-width="1.75rem" prop="otherExperience" style="width: 100%">
                <el-input style="width: 100%" v-model="form.otherExperience" type="textarea" placeholder="请输入"/>
              </el-form-item>
            </div>
          </div>
        </el-form>
        <div style="text-align: center;">
          <el-button :type="active >0?'primary':'warning'" v-if="active >0" @click="before">上一步</el-button>
          <el-button :type="active < 4?'primary':'warning'" @click="next">{{active<4?'下一步':'完成'}}</el-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import verify from "@/components/Process/Verify";
import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/oa/employeeInfo";
import { regionData, CodeToText } from "element-china-area-data";
import {parseTime} from "@/utils/ruoyi";
export default {
  name: "InfoForm",
  components: {
    verify
  },
  props: {
    businessKey: String, // 业务唯一标识
    parentTaskId: String, // 父级任务id
    taskId: String, // 任务id
    confirmVisible:{
      type: Boolean,
      default: true
    }
  },
  data() {
    return {
      active: 0,
      imageUrl1: '',
      imageUrl2: '',
      imageUrl3: '',
      // 表单参数
      form: {
        crimeExperience:undefined,
        violationExperience:undefined,
        hospitalExperience:undefined,
        limitExperience:undefined,
        entryExperience:undefined,
        educationAttachmnet:undefined
      },
      titleList:["填写岗位信息","填写个人基本信息","填写教育情况(从最高学历倒序填写)","填写工作经历(注：同一公司历任岗位逐一列明，从最近职务倒序填写)","填写其他情况说明"],
      radioList:[
        {
        label:"猎头",
        value:"猎头",
      },{
        label:"网站",
        value:"网站",
      },{
        label:"内部推荐",
        value:"内部推荐",
      },],
      sexList:[
        {
          label:"男",
          value:"男",
        },{
          label:"女",
          value:"女",
        }
      ],
      educationFormList:[
      {
        label:"统招本科及以上",
        value:"统招本科及以上",
      },
      {
        label:"统招专科",
        value:"统招专科",
      },
      {
        label:"非统招（成教/自考/网络教育）",
        value:"非统招（成教/自考/网络教育）",
      }
      ],
      options: regionData,
      selectedOptions: [],
      // 表单校验
      rules: {
        position: [
          { required: true, message: "应聘岗位不能为空", trigger: "blur" }
        ],
        channel: [
          { required: true, message: "获取岗位渠道不能为空", trigger: "blur" }
        ],
        name: [
          { required: true, message: "姓名不能为空", trigger: "blur" }
        ],
        sex: [
          { required: true, message: "性别不能为空", trigger: "change" }
        ],
        birthDate: [
          { required: true, message: "出生年月不能为空", trigger: "blur" }
        ],
        nation: [
          { required: true, message: "民族不能为空", trigger: "blur" }
        ],
        nativePlace: [
          { required: true, message: "籍贯不能为空", trigger: "blur" }
        ],
        homeLocation: [
          { required: true, message: "家庭所在地不能为空", trigger: "blur" }
        ],
        idNumber: [
          { required: true, message: "身份证号不能为空", trigger: "blur" }
        ],
        maritalStatus: [
          { required: true, message: "婚育状况不能为空", trigger: "blur" }
        ],
        politicalOutlook: [
          { required: true, message: "政治面貌不能为空", trigger: "blur" }
        ],
        technicalTitle: [
          { required: true, message: "技术职称不能为空", trigger: "blur" }
        ],
        phone: [
          { required: true, message: "手机号码不能为空", trigger: "blur" }
        ],
        email: [
          { required: true, message: "邮箱不能为空", trigger: "blur" }
        ],
        weight: [
          { required: true, message: "体重不能为空", trigger: "blur" }
        ],
        height: [
          { required: true, message: "身高不能为空", trigger: "blur" }
        ],
        speciality: [
          { required: true, message: "特长不能为空", trigger: "blur" }
        ],
        address: [
          { required: true, message: "身份证地址不能为空", trigger: "blur" }
        ],
        mailAddress: [
          { required: true, message: "通讯地址不能为空", trigger: "blur" }
        ],
        emergencyName: [
          { required: true, message: "紧急联系人姓名不能为空", trigger: "blur" }
        ],
        emergencyRelation: [
          { required: true, message: "紧急联系人关系不能为空", trigger: "blur" }
        ],
        emergencyPhone: [
          { required: true, message: "紧急联系人电话不能为空", trigger: "blur" }
        ],
        educationalExperience: [
          { required: true, message: "教育经历不能为空", trigger: "blur" }
        ],
        workExperience: [
          { required: true, message: "工作经历不能为空", trigger: "blur" }
        ],
        isCrime: [
          { required: true, message: "是否犯罪不能为空", trigger: "blur" }
        ],
        isViolation: [
          { required: true, message: "是否违纪不能为空", trigger: "blur" }
        ],
        isHospital: [
          { required: true, message: "是否入院不能为空", trigger: "blur" }
        ],
        isLimit: [
          { required: true, message: "是否对其他公司负竞业限制义务不能为空", trigger: "blur" }
        ],
        isEntry: [
          { required: true, message: "是否曾经入职不能为空", trigger: "blur" }
        ],
      },
      sendMessage: {},
      nationList: [
        {
          id: 1,
          label: "汉族",
          value: "汉族",
        },
        {
          id: 2,
          label: "壮族",
          value: "壮族",
        },
        {
          id: 3,
          label: "满族",
          value: "满族",
        },
        {
          id: 4,
          label: "回族",
          value: "回族",
        },
        {
          id: 5,
          label: "苗族",
          value: "苗族",
        },
        {
          id: 6,
          label: "维吾尔族",
          value: "维吾尔族",
        },
        {
          id: 7,
          label: "土家族",
          value: "土家族",
        },
        {
          id: 8,
          label: "彝族",
          value: "彝族",
        },
        {
          id: 9,
          label: "蒙古族",
          value: "蒙古族",
        },
        {
          id: 10,
          label: "藏族",
          value: "藏族",
        },
        {
          id: 11,
          label: "布依族",
          value: "布依族",
        },
        {
          id: 12,
          label: "侗族",
          value: "侗族",
        },
        {
          id: 13,
          label: "瑶族",
          value: "瑶族",
        },
        {
          id: 14,
          label: "朝鲜族",
          value: "朝鲜族",
        },
        {
          id: 15,
          label: "白族",
          value: "白族",
        },
        {
          id: 16,
          label: "哈尼族",
          value: "哈尼族",
        },
        {
          id: 17,
          label: "哈萨克族",
          value: "哈萨克族",
        },
        {
          id: 18,
          label: "黎族",
          value: "黎族",
        },
        {
          id: 19,
          label: "傣族",
          value: "傣族",
        },
        {
          id: 20,
          label: "畲族",
          value: "畲族",
        },
        {
          id: 21,
          label: "傈僳族",
          value: "傈僳族",
        },
        {
          id: 22,
          label: "仡佬族",
          value: "仡佬族",
        },
        {
          id: 23,
          label: "东乡族",
          value: "东乡族",
        },
        {
          id: 24,
          label: "高山族",
          value: "高山族",
        },
        {
          id: 25,
          label: "拉祜族",
          value: "拉祜族",
        },
        {
          id: 26,
          label: "水族",
          value: "水族",
        },
        {
          id: 27,
          label: "佤族",
          value: "佤族",
        },
        {
          id: 28,
          label: "纳西族",
          value: "纳西族",
        },
        {
          id: 29,
          label: "羌族",
          value: "羌族",
        },
        {
          id: 30,
          label: "土族",
          value: "土族",
        },
        {
          id: 31,
          label: "仫佬族",
          value: "仫佬族",
        },
        {
          id: 32,
          label: "锡伯族",
          value: 32,
        },
        {
          id: 33,
          label: "柯尔克孜族",
          value: "柯尔克孜族",
        },
        {
          id: 34,
          label: "达斡尔族",
          value: "达斡尔族",
        },
        {
          id: 35,
          label: "景颇族",
          value: "景颇族",
        },
        {
          id: 36,
          label: "毛南族",
          value: "毛南族",
        },
        {
          id: 37,
          label: "撒拉族",
          value: "撒拉族",
        },
        {
          id: 38,
          label: "布朗族",
          value: "布朗族",
        },
        {
          id: 39,
          label: "塔吉克族",
          value: "塔吉克族",
        },
        {
          id: 40,
          label: "阿昌族",
          value: "阿昌族",
        },
        {
          id: 41,
          label: "普米族",
          value: "普米族",
        },
        {
          id: 42,
          label: "鄂温克族",
          value: "鄂温克族",
        },
        {
          id: 43,
          label: "怒族",
          value: "怒族",
        },
        {
          id: 44,
          label: "京族",
          value: "京族",
        },
        {
          id: 45,
          label: "基诺族",
          value: "基诺族",
        },
        {
          id: 46,
          label: "德昂族",
          value: "德昂族",
        },
        {
          id: 47,
          label: "保安族",
          value: "保安族",
        },
        {
          id: 48,
          label: "俄罗斯族",
          value: "俄罗斯族",
        },
        {
          id: 49,
          label: "裕固族",
          value: "裕固族",
        },
        {
          id: 50,
          label: "乌孜别克族",
          value: "乌孜别克族",
        },
        {
          id: 51,
          label: "门巴族",
          value: "门巴族",
        },
        {
          id: 52,
          label: "鄂伦春族",
          value: "鄂伦春族",
        },
        {
          id: 53,
          label: "独龙族",
          value: "独龙族",
        },
        {
          id: 54,
          label: "塔塔尔族",
          value: "塔塔尔族",
        },
        {
          id: 55,
          label: "赫哲族",
          value: "赫哲族",
        },
        {
          id: 56,
          label: "珞巴族",
          value: "珞巴族",
        },
      ],
      maritalStatusList:[
        {
          label:"未婚未孕",
          value:"未婚未孕"
        },{
          label:"未婚已孕",
          value:"未婚已孕"
        },{
          label:"已婚未孕",
          value:"已婚未孕"
        },{
          label:"已婚已孕",
          value:"已婚已孕"
        },{
          label:"离异未孕",
          value:"离异未孕"
        },{
          label:"离异已孕",
          value:"离异已孕"
        },{
          label:"丧偶未孕",
          value:"丧偶未孕"
        },{
          label:"丧偶已孕",
          value:"丧偶已孕"
        }],
      politicalOutlookList:[
        {
          label:"中共党员",
          value:"中共党员"
        },
        {
          label:"中共预备党员",
          value:"中共预备党员"
        },
        {
          label:"共青团员",
          value:"共青团员"
        },
        {
          label:"民革党员",
          value:"民革党员"
        },
        {
          label:"民盟盟员",
          value:"民盟盟员"
        },
        {
          label:"民建会员",
          value:"民建会员"
        },
        {
          label:"民进会员",
          value:"民进会员"
        },
        {
          label:"农工党党员",
          value:"农工党党员"
        },
        {
          label:"致公党党员",
          value:"致公党党员"
        },
        {
          label:"九三学社社员",
          value:"九三学社社员"
        },
        {
          label:"台盟盟员",
          value:"台盟盟员"
        },
        {
          label:"无党派人",
          value:"无党派人"
        },
        {
          label:"群众",
          value:"群众"
        }
      ],
      isExperienceList:[
        {
          label:"否",
          value:"否"
        },
        {
          label:"是",
          value:"是"
        }
      ],
      educationList:[{}],
      jobList:[{}],
    };
  },
  watch: {
  },
  methods: {
    next(){
      if (this.active==4) {
        this.$confirm('本人郑重承诺：本登记表所填各项内容及本人提供的各项信息资料均属实，本人同意并接受贵司或贵司委托的第三方机构对本人进行背景调查及信息确认，如有任何不实，自愿无条件接受无偿解除劳动合同或相关用工协议, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.form.educationalExperience=JSON.stringify(this.educationList);
          this.form.workExperience=JSON.stringify(this.jobList);
          addInfo(this.form).then(res=>{
            if (res.code==200){
              this.$modal.msgSuccess("新增成功");
              this.reset();
              this.active=0;
            }
            // this.$modal.msgSuccess("新增成功");
          })
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '新增失败'
          });
        });
      }
      if (this.active<4){
        this.active++;
      }
    },
    before(){
      if (this.active>0){
        this.active--;
      }
    },

    // 表单重置
    reset() {
      this.form = {
        id: undefined,
        deptId: undefined,
        userId: undefined,
        position: undefined,
        departureTime: undefined,
        channel: undefined,
        referee: undefined,
        name: undefined,
        sex: undefined,
        birthDate: undefined,
        nation: undefined,
        nativePlace: undefined,
        homeLocation: undefined,
        idNumber: undefined,
        maritalStatus: "0",
        politicalOutlook: undefined,
        technicalTitle: undefined,
        speciality:undefined,
        weight:undefined,
        height:undefined,
        phone: undefined,
        email: undefined,
        address: undefined,
        mailAddress: undefined,
        emergencyName: undefined,
        emergencyRelation: undefined,
        emergencyPhone: undefined,
        educationalExperience: undefined,
        workExperience: undefined,
        isCrime: undefined,
        crimeExperience: undefined,
        isViolation: undefined,
        violationExperience: undefined,
        isHospital: undefined,
        hospitalExperience: undefined,
        isLimit:undefined,
        limitExperience:undefined,
        isEntry: undefined,
        entryExperience: undefined,
        otherExperience: undefined,
        createBy: undefined,
        updateBy: undefined,
        createTime: undefined,
        updateTime: undefined
      };
      this.educationList=[{}];
      this.jobList=[{}]
      this.resetForm("form");

    },
    addressChange(arr) {
      this.form.nativePlace =
        CodeToText[arr[0]] +
        "->" +
        CodeToText[arr[1]] +
        "->" +
        CodeToText[arr[2]];
      this.selectedOptions = [];
    },
    loadMap() {
      this.form.nativePlace = "";
      this.selectedOptions = [];
    },
    //删除表格里的行(申请状态)
    applyDeleteRow(index, rows) {
      rows.splice(index, 1);
    },
    jobAddRow(tableData){
      tableData.push({
        submitDateList: "",
        unit: "",
        position: "",
        salary: "",
        certifier: "",
        phone: "",
      });
    },
    applyAddRow(tableData){
      tableData.push({
        submitDateList: "",
        number: "",
        school: "",
        major: "",
        qualification: "",
        educationForm: "",
      });
    },
    isCrimeChange(){
      this.form.crimeExperience=undefined;
    },
    violationChange(){
      this.form.violationExperience=undefined;
    },
    hospitalChange(){
      this.form.hospitalExperience=undefined;
    },
    limitChange(){
      this.form.limitExperience=undefined;
    },
    entryChange(){
      this.form.entryExperience=undefined;
    }
  }
};
</script>
<style scoped>
/* 设置滚动条宽度和高度 */
::v-deep .el-table__body-wrapper::-webkit-scrollbar {
  width: 0.1rem; /* 横向滚动条 */
  height: 0.1rem; /* 纵向滚动条 必写 */
}
/* 设置滚动条样式 */
::v-deep .el-table__body-wrapper::-webkit-scrollbar-thumb {
  background-color: #dde;
  border-radius: 3px;
}
#selectForm >>> .el-form-item__label {
  font-size: 0.15rem;
}
::v-deep .bjsm .el-form-item__content{
  width: calc(100% - 1.625rem) !important;
}
::v-deep.mailAddress{
  .el-form-item__content{
    width: 75% !important;
  }
}
</style>


<style>
  html,body{
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
  }

  #app{
    width: 100%;
    height: 100%;
    /*overflow: auto;*/
    background-color: #2298ef;
  }
.box{
  width: 70%;
  height: calc(100% - 2.875rem);
  margin: -60px auto 0 auto;
  background-color: #ffffff;
  box-shadow: 0px 0px 15px 0.5px rgba(141, 141, 141, 0.9);
  border-radius: 0.0625rem;
  /*overflow: auto;*/
}
.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 0.075rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.avatar-uploader .el-upload:hover {
  border-color: #409EFF;
}
.avatar-uploader-icon {
  font-size: 0.35rem;
  color: #8c939d;
  width: 2.225rem;
  height: 2.225rem;
  line-height: 2.225rem;
  text-align: center;
}
.avatar {
  width: 2.225rem;
  height: 2.225rem;
  display: block;
}
</style>
